package com.ruan.controller;

import com.ruan.entity.Goods;
import com.ruan.entity.GoodsType;
import com.ruan.entity.Result;
import com.ruan.service.GoodsTypeService;
import com.ruan.utils.OssUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;
import java.util.List;

/**
 * @ClassName:GoodsTypeController
 * @Author:阮昇
 * @Description:
 * @Datetime: 2023/6/30 23:43
 **/
@RestController
@RequestMapping("/goods")
public class GoodsTypeController {

    @Autowired
    private GoodsTypeService goodsTypeService;

    @PostMapping("/addGoodsType")
    public Result addGoodsType(String goodsType){
        return goodsTypeService.addGoodsType(goodsType);
    }

    @RequestMapping("/getGoodsTypeList")
    public Result getGoodsTypeList(){
        return goodsTypeService.getGoodsTypeList();
    }

    @PostMapping("/editGoodsType")
    public Result editGoodsType(GoodsType goodsType){
        return goodsTypeService.editGoodsType(goodsType);
    }

    @RequestMapping("/deleteGoodsType/{id}")
    public Result deleteGoodsType(@PathVariable Integer id){
        return goodsTypeService.deleteGoodsType(id);
    }

}
